#pragma once
#include "event_listener.h"

class CxEventDispatcher
{
public:
    CxEventDispatcher(UINT nId);
    virtual ~CxEventDispatcher();

    BOOL RaiseEvent(UINT nEventId, WPARAM wParam, LPARAM lParam);
    BOOL AddEventListener(IxEventListener* pListener);
    BOOL RemoveEventListener(IxEventListener* pListener);
    BOOL ClearEventListener();

protected:

    typedef std::list<IxEventListener*> Listeners;
    typedef Listeners::iterator         ListenersIt;
    typedef Listeners::const_iterator   ListenersCIt;

    UINT        m_nDispatcherId;
    Listeners   m_ltListeners;
};